package com.lecyon.farm.base;

import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotBlank;

/**
 * @author Yao Zheng
 */
public class BaseRestRequest {
    /**
     * rest 请求
     */
    protected RestRequest restRequest;

    /**
     * httpRequest
     */
    protected HttpServletRequest httpRequest;

    /**
     * 用户 token
     */
    @NotBlank(message = "权限认证失败，令牌不能为空")
    protected String userToken;

    /**
     * Get rest request rest.
     *
     * @return the rest request
     */
    public RestRequest getRestRequest() {

        return restRequest;
    }

    /**
     * Set rest request.
     *
     * @param restRequest the rest request
     */
    public void setRestRequest(RestRequest restRequest) {

        this.restRequest = restRequest;
    }

    /**
     * Get http request http servlet.
     *
     * @return the http servlet request
     */
    public HttpServletRequest getHttpRequest() {

        return httpRequest;
    }

    /**
     * Set http request.
     *
     * @param httpRequest the http request
     */
    public void setHttpRequest(HttpServletRequest httpRequest) {

        this.httpRequest = httpRequest;
    }

    public String getUserToken() {
        return userToken;
    }

    public void setUserToken(String userToken) {
        this.userToken = userToken;
    }

    @Override
    public String toString() {
        return "BaseRestRequest{" +
                "restRequest=" + restRequest +
                '}';
    }
}
